package com.cxh.supermarket.im;

import java.util.Objects;
import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 功能描述:
 *
 * @author zxl
 * @since 2024/4/24
 */
@Getter
@AllArgsConstructor
public enum NotificationEnum {

  /**
   * 注册成功
   */
  REGISTER_SUCCESS("registerSuccess", Notification.PushLevel.SYSTEM_NOTIFICATIONS, "注册成功", "注册成功",
      "欢迎来到数智工福，我们每日为您提供超10万的靠谱工人和5000+条招工信息，快来招工找活吧"),

  /**
   * 招工信息未成功发布提醒
   * 您有${num}条招工信息未发布成功，完善信息完成发布，快速找到好工人!
   */
  LABOR_MESSAGE_UNSUCCESSFUL("laborMessageUnsuccessful", Notification.PushLevel.SYSTEM_NOTIFICATIONS, "招工找活", "招工信息已发布待审核",
      "您发布的招工信息正在审核中，请耐心等待!"),
  /**
   * 您的招工信息已通过审核
   */
  LABOR_MESSAGE_PASS("laborMessagePass", Notification.PushLevel.SYSTEM_NOTIFICATIONS, "招工找活", "您的招工信息已通过审核",
      "[${value}]信息已通过审核，请注意接听来电!"),

  /**
   * 找活结果
   */
  FIND_OUT_THE_RESULTS("findOutTheResults", Notification.PushLevel.SYSTEM_NOTIFICATIONS, "找活结果", "找活结果",
      "你申请的工作[${value}]已被招工方同意，请前往我的-劳务签约中查看"),

  /**
   * 邀您评价
   */
  INVITE_APPRAISE("inviteAppraise", Notification.PushLevel.SYSTEM_NOTIFICATIONS, "邀您评价", "邀您评价",
      "你已成功获得工作[${value}],可对老板进行评价"),

  /**
   * 报名通过
   */
  REGISTRATION_APPROVED("registrationApproved", Notification.PushLevel.SYSTEM_NOTIFICATIONS, "报名", "报名通知",
      "报名已通过，已生成《劳动协议》请及时签署，超24小时未签署合同将会失效。"),

  /**
   * 报名驳回
   */
  REGISTRATION_OVERRULED("registrationOverruled", Notification.PushLevel.SYSTEM_NOTIFICATIONS, "报名", "报名通知",
      "报名已被驳回，可更新名片信息后重新报名"),

  /**
   * 生成签署
   */
  GENERATE_SIGNATURES("generateSignatures", Notification.PushLevel.SYSTEM_NOTIFICATIONS, "报名", "报名通知",
      "已生成《劳动协议》请及时签署，超24小时未签署合同将会失效。"),

  ;

  /**
   * 业务名称
   */
  private final String businessName;
  /**
   * 一级推送
   */
  private final Notification.PushLevel pushLevel;


  /**
   * 分类 <a href="https://jnhgsz.yuque.com/ie4uf1/er3agk/va5pno2h02aiy0du#UFNiZ">参考分类</a>
   */
  private final String category;

  /**
   * 标题
   */
  private final String title;
  /**
   * 文案内容
   */
  private final String content;


  /**
   * 根据businessName获取枚举
   *
   * @param businessName 业务名称
   */
  public static NotificationEnum of(String businessName) {
    for (NotificationEnum notificationEnum : values()) {
      if (Objects.equals(notificationEnum.businessName, businessName)) {
        return notificationEnum;
      }
    }
    return null;
  }
}
